import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'

Vue.use(Vuex)

const hgoods = {
  namespaced: true,
  state: {
    count: 1,
    goodslist: []
  },
  mutations: {
    pushdata (state, data) {
      state.goodslist = data
    }
  },
  actions: {
    homeGoods (store) {
      axios({
        url:
          '/v2/page?pageId=1&tabId=10006&currentPage=1&pageSize=8&_=1583302178325',
        method: 'get'
      }).then(res => {
        store.commit('pushdata', res.data.data.modules)
      })
    }
  }
}
export default hgoods
